<?php

namespace Modules\Update\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Factory;

class UpdateServiceProvider extends ServiceProvider
{
    /**
     * Boot the application events.
     *
     * @return void
     */
    public function boot()
    {
        require __DIR__.'/../Routes/api.php';

        // $api = app('Dingo\Api\Routing\Router');
        // $api->version('v1', ['namespace' => 'Modules\Update\Tests'], function ($api) {
        //     $api->get('/u/version', ['uses' => 'Version@show']);
        //     // $api->resource('cart-items', "CartItemController", ['only' => $allMethod]);
        // });
    }

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $api = app('Dingo\Api\Routing\Router');
        $api->version('v1', ['namespace' => 'Modules\Update\Tests'], function ($api) {
            $api->get('/u/version', ['uses' => 'Version@show']);
        });
        $api->version('v1', ['namespace' => 'Modules\Update\Database\Seeders'], function ($api) {
            $api->post('/u/check', ['uses' => 'Check@store']);
        });
    }
}
